Skip to content

ci: run the test suite and request-boundary gate under opcache - #31

Merged
lisachenko merged 2 commits into
mainfrom
claude/z-engine-opcache-support-2u6p0z
Aug 20, 2026
Merged

lisachenko merged 2 commits into
mainfrom
claude/z-engine-opcache-support-2u6p0z

Conversation

@lisachenko

Copy link
Copy Markdown
Owner

What

Adds opcache-enabled coverage to the CI matrix — .github/workflows/ci.yml only, no source/test/tooling changes.

Two new matrix jobs (PHP 8.4 and 8.5 each):

  • tests-opcache — the full PHPUnit suite with opcache.enable_cli=1 (opcache.jit=off, opcache.jit_buffer_size=0), preceded by a guard step that asserts opcache is genuinely active in the CLI SAPI (opcache_get_status(false) !== false).
  • request-boundary-opcache — the real php-cgi/FastCGI multi-request gate (tools/request-boundary/run.sh 100) with opcache.enable=1, preceded by a guard asserting opcache is active in the CGI SAPI. This is the leg that first exercises the IS_STR_PERMANENT keep-by-pointer branch of Persister::persistStringSlot() across real RINIT/RSHUTDOWN boundaries: under opcache, the gate script's compile-time literals live in opcache SHM and are kept by pointer instead of being copied into persistent memory.

The four existing jobs now pin opcache.enable=0, opcache.enable_cli=0 explicitly. The CGI SAPI defaults opcache.enable to On, so on runners that ship the extension enabled the request-boundary gate was already running under opcache accidentally — without the pin, the old and new gate legs would be indistinguishable rather than a differential.

JIT stays off in every leg: it rewrites the executor internals z-engine hooks into.

Why

z-engine's opcache support recently landed, and FPM + opcache.preload is this package's blessed production setup (README "Deployment model") — yet no CI job loaded or enabled opcache (extensions: ffi only; the existing opcache.jit=off ini value was inert). The one opcache-conditional code path in src/ had never run in CI.

Verification

All legs replicated locally on PHP 8.4.24 and 8.5.9 (z-engine 8.4.2 / 8.5.0 resolved respectively), checking exit codes per AGENTS.md:

  • full suite, opcache off and opcache.enable_cli=1: exit 0 on both minors (190 tests, 15642 assertions)
  • request-boundary gate, opcache on and pinned off: GATE OK, exit 0 on both minors
  • guard scripts return 0 with opcache active and 1 without, in both CLI and CGI SAPIs

Out of scope (deliberately deferred)

Opcache-group PHPUnit tests for the permanent-string path, an opcache.preload/Core::preload() gate variant, and docs updates were planned but kept out of this pass at the author's request — CI changes only.

🤖 Generated with Claude Code

https://claude.ai/code/session_018oCKjaGwG27wE9rWdCqa6p


Generated by Claude Code

Two new matrix jobs prove the package under an opcache-enabled engine on
PHP 8.4 and 8.5: tests-opcache runs the whole PHPUnit suite with
opcache.enable_cli=1, and request-boundary-opcache drives the FastCGI
gate with opcache.enable=1, so preloaded-style SHM literals exercise the
IS_STR_PERMANENT keep-by-pointer branch of Persister::persistStringSlot()
across real RINIT/RSHUTDOWN boundaries. Guard steps assert opcache is
genuinely active in the matching SAPI before anything runs.

The four existing jobs now pin opcache.enable=0 and opcache.enable_cli=0
explicitly: the CGI SAPI defaults opcache.enable to On, so the
request-boundary gate ran under opcache accidentally on runners shipping
the extension enabled, which would have made the postures
indistinguishable. JIT stays off in every leg because it rewrites the
executor internals z-engine hooks into.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018oCKjaGwG27wE9rWdCqa6p
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Review feedback on #31: the request-boundary-opcache job comes out of CI
and stays as instructions for driving the gate under opcache locally
(the CGI SAPI defaults opcache.enable to On, so an unpinned php-cgi runs
it that way already), and a dependabot config keeps the workflow actions
current.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018oCKjaGwG27wE9rWdCqa6p
@lisachenko
lisachenko marked this pull request as ready for review August 20, 2026 16:12
@lisachenko
lisachenko merged commit d48f05b into main Aug 20, 2026
11 checks passed
@lisachenko
lisachenko deleted the claude/z-engine-opcache-support-2u6p0z branch August 20, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant